package com.hb.game.pk.adpter;

import android.app.Activity;

import com.chad.library.adapter.base.BaseViewHolder;

import android.widget.ImageView;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.hb.game.pk.R;
import com.hb.game.pk.utils.ScreenUtils;


public class ChooseHeadAdpter extends BaseQuickAdapter<Integer, BaseViewHolder> {
    private Activity act;

    public ChooseHeadAdpter(int layoutResId, Activity act) {
        super(layoutResId);
        this.act = act;
    }

    @Override
    protected void convert(BaseViewHolder helper, Integer item) {
        ImageView view = (ImageView) helper.getView(R.id.iv_head);
        int screenWidth = ScreenUtils.getScreenWidth(act);
        LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
                (int) (screenWidth / 4), (int) (screenWidth / 4));
        view.setLayoutParams(param);
        view.setBackgroundResource(item);
    }
}
